import { localData } from 'kuan-utils'

const authority = localData.create('yun_cang_admin')

// 获取用户信息
export function getUser() {
  return authority.get()
}

// 保存用户信息
export function setAuthority(userInfo) {
  authority.set(userInfo)
}

// 获取登陆token
export function getToken() {
  const user = getUser() || {}
  return user.token
}

// 获取授权路由标识
export function getAuthority() {
  const user = getUser() || {}
  return user.authority
}
